package com.example.demo.config;

import com.corundumstudio.socketio.Configuration;
import com.corundumstudio.socketio.SocketConfig;
import com.corundumstudio.socketio.SocketIOServer;

public class SocketIOServerConfig {
    public static SocketIOServer createServer() {
        //创建配置对象
        Configuration config = new Configuration();
        config.setHostname("127.0.0.1");
        config.setPort(9002);

        //设置一些可选的配置
        SocketConfig socketConfig = new SocketConfig();
        socketConfig.setReuseAddress(true);
        config.setSocketConfig(socketConfig);
        return new SocketIOServer(config);
    }
}
